home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d8
/
toes114g.arc
/
TOESDIAL.SLT
< prev
next >
Wrap
Text File
|
1991-05-21
|
11KB
|
275 lines
///////////////////////////// TOESDIAL.SLT //////////////////////////////////
// Version 1.14 - April 1991
// Written by Ken Ironside of 5:491/1
// Maintained by Allan Marillier of 5:491/1
//
// Golden City Fido (GCF) log-on script - OPUS specific
// PLEASE - read (or at least skim) the docs. There are no user configurable
// variables, or anything in this file any more.
// Modifications by Allan Marillier of 5:491/1 - September/October 1990
// More mods - Allan Marillier - February 1991
//
// Before using this script for the first time, or when you make a change,
// type 'cs toesdial' at the DOS prompt to compile the script for use by Telix.
//
// You must install this logon script and a password in your dialing
// directory in Telix. This script will pick up the password from there.
//
// Modifications by Allan Marillier of 5:491/1, September/October 1990
// Modified because Dave now uses YMS, and requires an extra
// Enter to get in ... (YMS being the mail checker Your Mail Sir)
// Also added code to check for BBS requesting a new password. If required,
// then check for file password.new. Pass that up twice to change the password
// on the BBS, then write out a message to the cap file. This is for BBS's
// where the sysop has decided to implement a facility to force passwords
// to change at whatever intervals.
// Feb 1991 - added code to set log file correctly, same as in TOES.SLT
// in case of messages when setting a new password. This was a result of
// the change in log file naming convention.
// Modified again in April 1991 to read the user name from the configuration
// file TOES.CNF
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
int pass_word_len = 6; // Golden City BBS wants 6 characters
str date_name[8]; // hold dated name of log file
str user_name[60];
str user_password[50];
str i_send_password[1];
/////////////////////////////////////////////////////////////////////////////
main()
{
int stat;
int t1, t2, t3, t4;
int tmark;
// following code added to prepare for opening log file to
// write report on password change, if required
int f; // general purpose file handle
str new_word[20]; // variable to hold the password
str temp_word[80]; // variable to hold the word read from password.new
str date_string[16] = ""; // To hold the date string
str log_file[4] = ".LOG"; // The shell of the capture file name
int temp_num; // Temp numeric variable
// open the TOES.CNF file, and read the user name. Skip past color, and
// dial_str
temp_num = fopen("TOES.CNF","r");
temp_word = "";
fgets(temp_word,3,temp_num); // read color
temp_word = "";
fgets(temp_word,60,temp_num); // read dial_str
user_name = "";
fgets(temp_word,80,temp_num); // read user name
if (strlen(temp_word) > 5)
user_name = temp_word;
else
{
clear_scr();
prints("WARNING ! The name is less than 5 characters. This is not acceptable !");
prints("Press any key to abort this script ....");
temp_num = inkeyw();
exittelix();
}
strcat(user_name,";y"); // concatenate ; and y
temp_word = "";
fgets(temp_word,80,temp_num); // mail packet
temp_word = "";
fgets(temp_word,80,temp_num); // reply packet
temp_word = "";
fgets(temp_word,80,temp_num); // reply dir
temp_word = "";
fgets(temp_word,80,temp_num); // mail dir
temp_word = "";
fgets(temp_word,3,temp_num); // make date packet
temp_word = "";
fgets(temp_word,3,temp_num); // zmodem_protocol
temp_word = "";
fgets(temp_word,3,temp_num); // auto_zap_opx
temp_word = "";
fgets(temp_word,3,temp_num); // i_send_password
if (temp_word == "Y")
i_send_password = "Y";
else
i_send_password = "N";
temp_word = "";
fgets(temp_word,53,temp_num); // user_password
user_password = temp_word;
fclose(temp_num);
set_date_name();
strcat(date_string,date_name);
strcat(date_string,log_file);
alarm (1);
if (not _entry_pass && i_send_password == "N") // no password, so didn't recog. board
{
prints ("Sorry, I don't know the password for this BBS!");
return;
}
cputs ("^M"); // Dave's board seems to need a
cputs ("^M"); // few CR's to get going!
t1 = track ("Please press your Escape key to enter the BBS, or wait 30 seconds....", 0);
t2 = track ("What is your FIRST name: ", 0);
t3 = track ("More [Y,n,=]? ");
t4 = track ("Enter a NEW Password");
tmark = timer_start (600); // wait up to 1 minutes for login
while (not time_up (tmark))
{
terminal(); // let Telix process any chars and keys
stat = track_hit (0); // see which (if any) track was hit
if (stat == t1) // We'll need to wake up the BBS
{
cputs ("^["); // send Esc
}
else if (stat == t2) // send name
{
// cputs (user_first_name);
cputs(user_name);
cputs ("^M");
break; // Exit the loop
}
}
track_free (0); // Free up all track channels
waitfor ("Password: ",30);
{
if (i_send_password == "Y")
cputs(user_password);
else
cputs (_entry_pass);
cputs ("^M");
}
// added code here to check if a new password is required.
// If so - check for file password.new - read the new word, pass
// it up, pass it again for verification, then write a message to
// the cap file. Rename the file password.new to force the user
// to create another for the next time
stat = track_hit(0);
if (stat == t4) // it's time to change the password ...
{
if (filefind("password.new",pass_word_len) != 0) // check for normal, hidden, system
{
f = fopen("password.new","r"); // open the file if it exists
fgets(temp_word,80,f); // read into new_word, up to 80 chars
fclose(f); // close the file
temp_num = strpos(temp_word," ",0); // check for spaces
if (temp_num == -1)
temp_num = strlen(temp_word); // cater for no spaces in the line
substr(temp_word,0,temp_num,new_word); // extract first word only
if (strlen(new_word) < 6)
{
// length of word is not acceptable
// write message to the log file, then exit the script
f = fopen(date_string,"a"); // re-open the log file for appending
fputs("^M^J",f);
fputs("************************************************************^M^J",f);
fputs("WARNING ! The BBS expects you to enter a new PASSWORD^M^J",f);
fputs("The file named PASSWORD.NEW was found. The length of the word^M^J",f);
fputs(" in this file was too short. The BBS expects a minimum of 6^M^J",f);
fputs(" chars as a NEW password. Please correct this file, and re-run^M^J",f);
fputs(" this script, OR connect to the BBS manually, and change the^M^J",f);
fputs(" password yourself.^M^J",f);
fputs("************************************************************^M^J",f);
fclose(f);
exittelix(0,1); // hang up, set error level to 0 and quit telix
}
// assume if we got here, word length is OK -
// write message to the log file, then exit the script
frename("password.new","password.old"); // rename to prevent further use
f = fopen(date_string,"a"); // re-open the log file for appending
fputs("^M^J",f);
fputs("************************************************************^M^J",f);
fputs("WARNING ! The BBS expects you to enter a new PASSWORD^M^J",f);
fputs(" the word * ",f);
fputs(new_word,f);
fputs(" * was found to be acceptable.^M^J",f);
fputs(" PLEASE NOTE ! check this log to see if the password was accepted.^M^J",f);
fputs(" If it was, you must modify your Telix dialling directory accordingly.^M^J",f);
fputs("************************************************************^M^J",f);
cputs (new_word); // now send the new password
cputs ("^M");
waitfor ("Re-Enter Password for verification",30); // wait until verify
{
cputs (new_word); // and send the password again to verify ...
cputs ("^M");
}
}
else // the password.new file doesn't exist
{
// write message to the log file, then exit the script
f = fopen(date_string,"a"); // re-open the log file for appending
fputs("^M^J",f);
fputs("************************************************************^M^J",f);
fputs("WARNING ! The BBS expects you to enter a new PASSWORD^M^J",f);
fputs("No file named PASSWORD.NEW was found. If a file of this name^M^J",f);
fputs(" had existed, with a single word in it, this would have been^M^J",f);
fputs(" used as a NEW password. Please create this file, and re-run^M^J",f);
fputs(" this script, OR connect to the BBS manually, and change the^M^J",f);
fputs(" password yourself.^M^J",f);
fputs("************************************************************^M^J",f);
fclose(f);
exittelix(0,1); // hang up, set error level to 0 and quit telix
}
// end of code to check if new password is required
} // end of checking if new password is required by BBS
waitfor ("Press ENTER to continue ",30); // this is the initial one
cputs("^M");
// added the following lines to get around the YMS program
// reporting on mail in areas 1 and 3, then pausing
if (waitfor ("Press ENTER to continue ",30))
cputs("^M");
// now add another one to get past the message if subscriptions are due
// if (waitfor ("Press ENTER to continue ",15))
// cputs("^M");
if (time_up (tmark))
prints ("Logon failed!");
timer_free (tmark); // free timer channel
}
/////////////////////////////////////////////////////////////////////////////
set_date_name()
// function to read date and set variable date_name in YYMMDD format
{
str dat[4]; // temp to hold dates
int temp; // Temp variable to hold the numeric date value
temp = curtime();
itos(tyear(temp),dat);
strcat (date_name,dat);
delchrs(date_name,0,2); // remove the century digits
itos(tmonth(temp),dat);
if (tmonth(temp) < 10) // precede 1 to 9 with 0
strcat(date_name,"0");
strcat (date_name,dat);
itos(tday(temp),dat);
if (tday(temp) < 10) // precede 1 to 9 with 0
strcat(date_name,"0");
strcat (date_name,dat);
} // end set_date_name
/////////////////////////////////////////////////////////////////////////////